#!/bin/sh

file=$(basename $0)

if vmstat --help | grep -q -F 'timestamp'; then
	opt_timestamp='--timestamp'
else
	opt_timestamp=
fi

if [ -z "$interval" ]; then
	if [ "$file" = heartbeat ]; then
		if [ -n "$runtime" ] && [ "$runtime" -gt 36000 ]; then
			interval=100
		else
			interval=10
		fi
	else
		interval=1
	fi
fi

exec vmstat $opt_timestamp -n $interval $count
